package per.ethan.javase.base;

/**
 * @author Ethan
 * @date 2020/04/26 14:48
 */
public class NineNineTable {

    public static void main(String[] args) {
        printNineNineTable();

        System.out.println("------------------------------------------------------------");

        printSanJiao();
    }

    private static void printNineNineTable() {
        for (int i = 1; i < 10; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.print(j + "*" + i + "=" + i * j + "\t");
            }
            System.out.println();
        }
    }

    private static void printSanJiao() {
        for (int i = 1; i <= 5; i++) {

            for (int j = 5; j >= i; j--) {
                System.out.print(" ");
            }

            for (int j = 1; j <= i; j++) {
                System.out.print("*");
            }

            for (int j = 1; j < i; j++) {
                System.out.print("*");
            }

            System.out.println();
        }
    }

}
